<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:gui="clr-namespace:DentalGUIHelper;assembly=DentalConfig"
	xmlns:sys="clr-namespace:System;assembly=mscorlib">
	<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
	<sys:Int32 x:Key="PleaseWaitWindow_XOffset">-10</sys:Int32>
	<sys:Int32 x:Key="PleaseWaitWindow_YOffset">10</sys:Int32>

    <!-- PleaseWaitWindow Style -->
    <Style TargetType="{x:Type gui:PleaseWaitWindow}">
        <Setter Property="Background" Value="{DynamicResource ToolWindowBackgroundBrush}" />
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderBrush" Value="{DynamicResource BrandBrush1}" />
		<Setter Property="SizeToContent" Value="Height"/>
		<Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type gui:PleaseWaitWindow}">
                    <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
                        <Grid Background="{TemplateBinding Background}">
                            <AdornerDecorator>
                                <DockPanel Background="{TemplateBinding Background}">
                                    <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> 
										<TextBlock Margin="5,5,5,5" Grid.Row="0" Text="{TemplateBinding ShowingMessage}" Visibility="{TemplateBinding MessageTextVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
										<Grid >
											<Grid.ColumnDefinitions>
												<ColumnDefinition Width="*"/>
												<ColumnDefinition Width="Auto"/>
											</Grid.ColumnDefinitions>
											<gui:BizzySpinner Grid.Column="0" Width="20" Height="20" Spin="true" VerticalAlignment="Center" Margin="5,5,5,5" />
											<Button IsCancel="True" HorizontalAlignment="Right" Padding="5,5,5,5" Margin="2,2,2,2" Grid.Column="1" x:Name="PART_CancelButton" Content="{TemplateBinding CancelButtonContent}" Visibility="{TemplateBinding CancelButtonVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
										</Grid>
									</StackPanel>
                                </DockPanel>
                            </AdornerDecorator>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>